/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.farmcode.base.manager;

import com.farmcode.base.dao.BaseDAO;
import com.farmcode.base.dao.BaseFilter;
import java.util.List;

/**
 *
 * @author oiprado
 */
public abstract class BaseManagerSpc<J>//<T extends BaseDAO<J>, J> implements  BaseManager<T, J>
{
  private BaseFilter baseFilter;
  protected BaseDAO<J> baseDAO;

  public BaseManagerSpc() {
  } 
  
//  @EJB
//  private T daoImpl;
//  @Override
  public abstract void create(J entity) throws FacadeException;
//  {
//    try {
//      daoImpl.create(entity);
//    } catch (DAOException ex) {
//      Logger.getLogger(BaseManagerSpc.class.getName()).log(Level.SEVERE, null, ex);
//      throw wrapException(ex);
//    }
//  }

//  @Override
  public abstract void store(J entity) throws FacadeException;
//  {
//    try {
//      daoImpl.store(entity);
//    } catch (DAOException ex) {
//      Logger.getLogger(BaseManagerSpc.class.getName()).log(Level.SEVERE, null, ex);
//      throw wrapException(ex);
//    }
//  }

//  @Override
  public abstract void remove(J entity) throws FacadeException;
//  {
//    try {
//      daoImpl.remove(entity);
//    } catch (DAOException ex) {
//      Logger.getLogger(BaseManagerSpc.class.getName()).log(Level.SEVERE, null, ex);
//      throw wrapException(ex);
//    }
//  }
//
//  @Override

  public abstract List<J> find() throws FacadeException;
//  {
//    try {
//      return daoImpl.find();
//    } catch (DAOException ex) {
//      Logger.getLogger(BaseManagerSpc.class.getName()).log(Level.SEVERE, null, ex);
//      throw wrapException(ex);
//    }
//  }

  

  protected FacadeException wrapException(Exception ex) {
    return new FacadeException(ex);
  }

  /**
   * @return the baseFilter
   */
  public BaseFilter getBaseFilter() {
    return baseFilter;
  }

  /**
   * @param baseFilter the baseFilter to set
   */
  public void setBaseFilter(BaseFilter baseFilter) {
    this.baseFilter = baseFilter;
  }
}
